
cjson = require "cjson.safe"
local http2tcp = require "http2tcp"
local resp = {
	msg = "ok",
	code = 0 
}

http2tcp:new("127.0.0.1", 9877)

local taskid = tonumber(ngx.var.arg_taskid)
local cmd    = "stop"
http2tcp:send({taskid=taskid, is_force=0, name="", command=cmd, payload=""})

local data = http2tcp:receive()
data.taskid = taskid
resp.data = data
ngx.say(cjson.encode(resp))
